import {
	authenticate
} from "./apibase.js";
import {
	dev_base_db,
	stage_base_db,
	prod_base_db,
} from "@/config.js";
let baseDb = '';
const accountInfo = uni.getAccountInfoSync();
if (accountInfo?.miniProgram?.envVersion === 'develop') { //开发版
	baseDb = dev_base_db;
} else if (accountInfo?.miniProgram?.envVersion === 'trial') { //体验版
	baseDb = stage_base_db;
} else { //正式版
	baseDb = prod_base_db;
}
// 登录
export const login = (params) => {
	params = {
		db: baseDb,
		...params
	};
	return authenticate(params);
}